/* Portfolio GUI */
#include "Port_Global.h"
#include "Colorvar.h"
#include "Portfolio.h"

char defaultmsg[100][256];
char menutext[50][256];
int messages = 0;

//Load Global Text Messages
void loadmsg()
{
	fstream fopen;
	fopen.open("data/Defaultmsg.txt",ios::in);
	while(!fopen.eof())
	{
		fopen.getline(defaultmsg[messages], 255);
		messages++;
	}
	defaultmsg[0][0] = '\0';
}

//=====================================================================================//
//Main
//=====================================================================================//
void main()
{

	Portfolio *port = new Portfolio();
	port->setupAllegro();
	port->startGUI();

}
END_OF_MAIN();

void circleline( BITMAP *B_Buffer, int x, int y, int d)
{
	circle(B_Buffer, x, y, d, makecol(0,0,0) );
}
void startproc(char * program, char * direc)
{
	STARTUPINFO si;
	PROCESS_INFORMATION pi;

	ZeroMemory( &si, sizeof(si) );
	si.cb = sizeof(si);
	ZeroMemory( &pi, sizeof(pi) );

	// Start the child process. 
	ASSERT(CreateProcess( NULL,   // No module name (use command line). 
		program,	// Command line. 
		NULL,		// Process handle not inheritable. 
		NULL,		// Thread handle not inheritable. 
		FALSE,		// Set handle inheritance to FALSE. 
		0,			// No creation flags. 
		NULL,		// Use parent's environment block. 
		direc,		// Use parent's starting directory. 
		&si,		// Pointer to STARTUPINFO structure.
		&pi )		// Pointer to PROCESS_INFORMATION structure.
		);
	
		// Wait until child process exits.
		WaitForSingleObject( pi.hProcess, INFINITE );

	// Close process and thread handles. 
	CloseHandle( pi.hProcess );
	CloseHandle( pi.hThread );
}